Skip to content

Commit f6dfe83

Browse files
authored
Minor cleanup for the CMake configuration. (#8588)
- Remove unnecessary installs. Some of this files are not need to be in the final install. They are need at build time internally. - 3rdParty - Set status messages as STATUS - Fix installation lib dirs from just lib to ${CMAKE_INSTALL_LIBDIR} - Change pkgconfig to pkgconfig
1 parent d6e04c0 commit f6dfe83

File tree

10 files changed

+25
-28
lines changed

10 files changed

+25
-28
lines changed

OMCompiler/Makefile.common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ libzmq: $(builddir_lib_omc)/$(LIBZMQLIB)
407407
$(builddir_lib_omc)/$(LIBZMQLIB):
408408
test -d 3rdParty/libzmq
409409
mkdir -p 3rdParty/libzmq/build
410-
(cd 3rdParty/libzmq/build && test -f Makefile || CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(CMAKE) -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_AR:String="$(AR)" -DCMAKE_INSTALL_PREFIX="`pwd`" -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DWITH_PERF_TOOL:Bool=OFF -DZMQ_BUILD_TESTS:Bool=OFF -DENABLE_CPACK:Bool=OFF -DCMAKE_BUILD_TYPE=Release .. -G $(CMAKE_TARGET))
410+
(cd 3rdParty/libzmq/build && test -f Makefile || CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(CMAKE) -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_AR:String="$(AR)" -DCMAKE_INSTALL_PREFIX="`pwd`" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DWITH_PERF_TOOL:Bool=OFF -DZMQ_BUILD_TESTS:Bool=OFF -DENABLE_CPACK:Bool=OFF -DCMAKE_BUILD_TYPE=Release .. -G $(CMAKE_TARGET))
411411
test -f 3rdParty/libzmq/build/lib/$(LIBZMQLIB) || $(MAKE) -C 3rdParty/libzmq/build install
412412
test ! `uname` = Darwin || install_name_tool -id @rpath/$(LIBZMQLIB) 3rdParty/libzmq/build/lib/$(LIBZMQLIB)
413413
# copy dll/so to $(LIB_OMC) and $(builddir_bin) folders

OMCompiler/SimulationRuntime/cpp/cmake_3.14.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ add_subdirectory(FMU2)
3030
## This little function will give us the filename of the CPP runtime
3131
## library given its alias.
3232
function (omc_get_library_filename target_alias LIB_FILENAME)
33-
message(STATUS ${target_alias})
3433
get_target_property(LIB_FILENAME_LOCAL ${target_alias} ALIASED_TARGET)
35-
message(STATUS ${LIB_FILENAME_LOCAL})
3634
set(${LIB_FILENAME} ${CMAKE_SHARED_LIBRARY_PREFIX}${LIB_FILENAME_LOCAL}${CMAKE_SHARED_LIBRARY_SUFFIX} PARENT_SCOPE)
3735
endfunction(omc_get_library_filename)
3836

3937
## Get the actual output filenames of the CPP runtime shared libs
40-
## This are to be used in LibrariesConfig for the purpose of loading the
38+
## This are to be used in LibrariesConfig.h for the purpose of loading the
4139
## libs at simulation time using their file name.
4240
omc_get_library_filename(omc::simrt::cpp::core::system SYSTEM_LIB)
4341
omc_get_library_filename(omc::simrt::cpp::core::dataexchange DATAEXCHANGE_LIB)

OMEdit/OMEditLIB/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,5 +298,3 @@ target_include_directories(OMEditLib PRIVATE
298298

299299
target_link_options(OMEditLib PRIVATE -Wl,--no-undefined)
300300

301-
install(TARGETS OMEditLib)
302-

OMEdit/OMEditLIB/OMEditLIB.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ INCLUDEPATH += . ../ \
9393
$$OPENMODELICAHOME/include/omc/c/util \
9494
$$OPENMODELICAHOME/include/omc/fmil \
9595
$$OPENMODELICAHOME/../OMParser/ \
96-
$$OPENMODELICAHOME/../OMParser/install/include/antlr4-runtime/
96+
$$OPENMODELICAHOME/../OMParser/3rdParty/antlr4/runtime/Cpp/runtime/src
9797

9898
# Don't show the warnings from included headers.
9999
# Don't add a space between for and open parenthesis below. Qt4 complains about it.

OMParser/3rdParty/antlr4/runtime/Cpp/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ option(WITH_STATIC_CRT "(Visual C++) Enable to statically link CRT, which avoids
2525

2626
project(LIBANTLR4)
2727

28+
include(GNUInstallDirs)
29+
2830
if(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR
2931
CMAKE_VERSION VERSION_GREATER "3.0.0")
3032
CMAKE_POLICY(SET CMP0026 NEW)
@@ -147,7 +149,6 @@ endif(WITH_DEMO)
147149
# Generate CMake Package Files only if install is active
148150
if (ANTLR4_INSTALL)
149151

150-
include(GNUInstallDirs)
151152
include(CMakePackageConfigHelpers)
152153

153154
if(NOT ANTLR4_CMAKE_DIR)

OMParser/3rdParty/antlr4/runtime/Cpp/runtime/CMakeLists.txt

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,21 @@ set_target_properties(antlr4_static
110110
ARCHIVE_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}
111111
COMPILE_FLAGS "${disabled_compile_warnings} ${extra_static_compile_flags}")
112112

113-
install(TARGETS antlr4_shared
114-
DESTINATION lib
115-
EXPORT antlr4-targets)
116-
install(TARGETS antlr4_static
117-
DESTINATION lib
118-
EXPORT antlr4-targets)
119-
120-
install(DIRECTORY "${PROJECT_SOURCE_DIR}/runtime/src/"
121-
DESTINATION "include/antlr4-runtime"
122-
COMPONENT dev
123-
FILES_MATCHING
124-
PATTERN "*.h"
125-
PATTERN "UTF8_LICENSE"
113+
install(TARGETS antlr4_shared antlr4_static
114+
EXPORT antlr4-targets
115+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
116+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
117+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
126118
)
127119

128120

121+
# install(DIRECTORY "${PROJECT_SOURCE_DIR}/runtime/src/"
122+
# DESTINATION "include/antlr4-runtime"
123+
# COMPONENT dev
124+
# FILES_MATCHING
125+
# PATTERN "*.h"
126+
# PATTERN "UTF8_LICENSE"
127+
# )
128+
129+
129130

OMParser/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ else
1414
CMAKE_TARGET = "Unix Makefiles"
1515
endif
1616

17-
override CXXFLAGS += -Iinstall/include/antlr4-runtime -std=c++11 -DANTLR4CPP_STATIC
17+
override CXXFLAGS += -I3rdParty/antlr4/runtime/Cpp/runtime/src -std=c++11 -DANTLR4CPP_STATIC
1818

1919
CPP_FILES=modelicaBaseListener.cpp modelicaBaseVisitor.cpp modelicaLexer.cpp modelicaListener.cpp modelicaParser.cpp modelicaVisitor.cpp
2020
H_FILES=$(patsubst %.cpp,%.h,$(CPP_FILES))
@@ -26,7 +26,7 @@ libOMParser.a: $(OBJS)
2626
$(AR) -s -r $@ $(OBJS)
2727
mkdir -p $(OMBUILDDIR)/lib/$(host_short)/omc/ $(OMBUILDDIR)/include/omc/
2828
cp -pR $@ $(OMBUILDDIR)/lib/$(host_short)/omc/
29-
cp -pR install/include/antlr4-runtime $(OMBUILDDIR)/include/omc/
29+
# cp -pR install/include/antlr4-runtime $(OMBUILDDIR)/include/omc/
3030

3131
$(OBJS): $(CPP_FILES) install/lib/libantlr4-runtime.a
3232

OMPlot/qwt/src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,5 +258,5 @@ target_compile_definitions(qwt PRIVATE QWT_MOC_INCLUDE)
258258
target_link_options(qwt PRIVATE -Wl,--no-undefined)
259259

260260

261-
install (FILES ${QWT_HEADERS} DESTINATION include/qwt)
262-
install (TARGETS qwt)
261+
# install (FILES ${QWT_HEADERS} DESTINATION include/qwt)
262+
install (TARGETS qwt)

OMShell/OMShell/OMShellGUI/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set(OMSHELLLIB_HEADERS commandcompletion.h
1010
oms.h)
1111

1212

13-
add_library(OMShellLib SHARED ${OMSHELLLIB_SOURCES} ${OMSHELLLIB_HEADERS})
13+
add_library(OMShellLib STATIC ${OMSHELLLIB_SOURCES} ${OMSHELLLIB_HEADERS})
1414
target_compile_definitions(OMShellLib PRIVATE OMSHELLLIB_MOC_INCLUDE)
1515

1616
target_link_libraries(OMShellLib PUBLIC Qt5::Xml)
@@ -25,7 +25,6 @@ target_link_options(OMShellLib PRIVATE -Wl,--no-undefined)
2525
add_executable(OMShell WIN32 MACOSX_BUNDLE main.cpp rc_omshell.rc)
2626
target_link_libraries(OMShell PRIVATE OMShellLib)
2727

28-
install(TARGETS OMShellLib)
2928
install(TARGETS OMShell)
3029

3130
install(FILES commands.xml

0 commit comments

Comments
 (0)