mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-11 21:50:34 +05:00
fix tcl/tk build flags
This commit is contained in:
parent
66078cb285
commit
03347e8e33
@ -251,40 +251,47 @@ endif(USE_GUI)
|
|||||||
target_link_libraries(nglib PUBLIC ${ZLIB_LIBRARIES})
|
target_link_libraries(nglib PUBLIC ${ZLIB_LIBRARIES})
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
if(WIN32)
|
||||||
|
add_library(netgen_gui INTERFACE IMPORTED)
|
||||||
|
else()
|
||||||
|
add_library(netgen_gui INTERFACE)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (USE_GUI)
|
if (USE_GUI)
|
||||||
find_package(TCL 8.5 REQUIRED)
|
find_package(TCL 8.5 REQUIRED)
|
||||||
find_package(TclStub 8.5 REQUIRED)
|
find_package(TclStub 8.5 REQUIRED)
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework AppKit")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework AppKit")
|
||||||
target_link_libraries(nggui PUBLIC "-framework AppKit")
|
target_link_libraries(netgen_gui INTERFACE "-framework AppKit")
|
||||||
else(APPLE)
|
else(APPLE)
|
||||||
find_package(X11 REQUIRED)
|
find_package(X11 REQUIRED)
|
||||||
target_link_libraries( nggui PUBLIC ${X11_Xmu_LIB} ${X11_X11_LIB})
|
target_link_libraries( netgen_gui INTERFACE ${X11_Xmu_LIB} ${X11_X11_LIB})
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
|
|
||||||
target_compile_definitions(nggui PUBLIC -DTCL -DOPENGL -DUSE_TOGL_2 PRIVATE -DUSE_TCL_STUBS -DUSE_TK_STUBS)
|
target_compile_definitions(netgen_gui INTERFACE -DTCL -DOPENGL -DUSE_TOGL_2 -DUSE_TCL_STUBS -DUSE_TK_STUBS)
|
||||||
target_include_directories(nggui PRIVATE ${TCL_INCLUDE_PATH} ${TK_INCLUDE_PATH})
|
target_include_directories(netgen_gui INTERFACE ${TCL_INCLUDE_PATH} ${TK_INCLUDE_PATH})
|
||||||
|
target_link_libraries(netgen_gui INTERFACE ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY})
|
||||||
if(NOT EXISTS ${TK_INCLUDE_PATH}/tkWin.h AND EXISTS ${TK_INCLUDE_PATH}/../win/tkWin.h)
|
if(NOT EXISTS ${TK_INCLUDE_PATH}/tkWin.h AND EXISTS ${TK_INCLUDE_PATH}/../win/tkWin.h)
|
||||||
target_include_directories(nggui PRIVATE ${TK_INCLUDE_PATH}/../win)
|
target_include_directories(netgen_gui INTERFACE ${TK_INCLUDE_PATH}/../win)
|
||||||
endif()
|
endif()
|
||||||
if(NOT EXISTS ${TK_INCLUDE_PATH}/x11/Xlib.h AND EXISTS ${TK_INCLUDE_PATH}/../xlib/X11/Xlib.h)
|
if(NOT EXISTS ${TK_INCLUDE_PATH}/x11/Xlib.h AND EXISTS ${TK_INCLUDE_PATH}/../xlib/X11/Xlib.h)
|
||||||
target_include_directories(nggui PRIVATE ${TK_INCLUDE_PATH}/../xlib)
|
target_include_directories(netgen_gui INTERFACE ${TK_INCLUDE_PATH}/../xlib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(nggui PUBLIC nglib togl
|
target_link_libraries(nggui PUBLIC nglib togl PRIVATE "$<BUILD_INTERFACE:netgen_python>" )
|
||||||
PRIVATE "$<BUILD_INTERFACE:netgen_python>" )
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_compile_definitions(nggui PUBLIC -DTOGL_WGL)
|
target_compile_definitions(netgen_gui INTERFACE -DTOGL_WGL)
|
||||||
else(WIN32)
|
endif()
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
target_compile_definitions(nggui PUBLIC -DTOGL_NSOPENGL)
|
target_compile_definitions(netgen_gui INTERFACE -DTOGL_NSOPENGL)
|
||||||
else(APPLE)
|
endif()
|
||||||
target_compile_definitions(nggui PUBLIC -DTOGL_X11)
|
if(UNIX AND NOT APPLE)
|
||||||
endif(APPLE)
|
target_compile_definitions(netgen_gui INTERFACE -DTOGL_X11)
|
||||||
endif(WIN32)
|
endif()
|
||||||
|
|
||||||
endif (USE_GUI)
|
endif (USE_GUI)
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
@ -23,13 +23,12 @@ if(USE_GUI)
|
|||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_sources(netgen PRIVATE ../windows/netgen.rc)
|
target_sources(netgen PRIVATE ../windows/netgen.rc)
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
target_link_libraries( netgen nglib nggui netgen_python ${TK_LIBRARY} ${TCL_LIBRARY})
|
target_link_libraries( netgen nglib nggui netgen_python netgen_gui)
|
||||||
target_include_directories(netgen PRIVATE ${TCL_INCLUDE_PATH} ${TK_INCLUDE_PATH})
|
|
||||||
install(TARGETS netgen ${NG_INSTALL_DIR})
|
install(TARGETS netgen ${NG_INSTALL_DIR})
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set_target_properties(netgen PROPERTIES OUTPUT_NAME netgen)
|
set_target_properties(netgen PROPERTIES OUTPUT_NAME netgen)
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
target_link_libraries( netgen ${PYTHON_LIBRARIES})
|
target_link_libraries( netgen ${PYTHON_LIBRARIES} ${TCL_LIBRARY} ${TK_LIBRARY})
|
||||||
endif(NOT BUILD_FOR_CONDA)
|
endif(NOT BUILD_FOR_CONDA)
|
||||||
|
|
||||||
install(TARGETS nggui ${NG_INSTALL_DIR})
|
install(TARGETS nggui ${NG_INSTALL_DIR})
|
||||||
@ -49,7 +48,7 @@ if(USE_PYTHON)
|
|||||||
|
|
||||||
if(USE_GUI)
|
if(USE_GUI)
|
||||||
add_library(ngguipy SHARED ngguipy.cpp)
|
add_library(ngguipy SHARED ngguipy.cpp)
|
||||||
target_link_libraries( ngguipy PUBLIC nglib nggui PRIVATE "$<BUILD_INTERFACE:netgen_python>" )
|
target_link_libraries( ngguipy PUBLIC nglib nggui PRIVATE "$<BUILD_INTERFACE:netgen_python>" $<BUILD_INTERFACE:netgen_gui>)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set_target_properties( ngguipy PROPERTIES SUFFIX ".so")
|
set_target_properties( ngguipy PROPERTIES SUFFIX ".so")
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
|
@ -11,18 +11,9 @@ else(WIN32)
|
|||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
add_library(togl ${TOGL_LIBRARY_TYPE} togl.c toglProcAddr.c toglStubInit.c)
|
add_library(togl ${TOGL_LIBRARY_TYPE} togl.c toglProcAddr.c toglStubInit.c)
|
||||||
if(WIN32)
|
target_link_libraries( togl PUBLIC $<BUILD_INTERFACE:netgen_gui>)
|
||||||
target_compile_definitions(togl PUBLIC -DTOGL_WGL)
|
|
||||||
else(WIN32)
|
|
||||||
if(APPLE)
|
|
||||||
target_compile_definitions(togl PUBLIC -DTOGL_NSOPENGL)
|
|
||||||
else(APPLE)
|
|
||||||
target_compile_definitions(togl PUBLIC -DTOGL_X11)
|
|
||||||
endif(APPLE)
|
|
||||||
endif(WIN32)
|
|
||||||
target_link_libraries(togl PUBLIC ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY})
|
|
||||||
|
|
||||||
target_compile_definitions(togl PRIVATE -DBUILD_togl=1 -DSTDC_HEADERS=1 -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1)
|
target_compile_definitions(togl PRIVATE -DBUILD_togl=1 -DSTDC_HEADERS=1)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_compile_definitions(togl PRIVATE -DUNICODE -D_UNICODE -DTOGL_USE_FONTS=0 -DSTDC_HEADER)
|
target_compile_definitions(togl PRIVATE -DUNICODE -D_UNICODE -DTOGL_USE_FONTS=0 -DSTDC_HEADER)
|
||||||
|
Loading…
Reference in New Issue
Block a user